home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Development
/
Source
/
MSG Demo 1.4.source Folder
/
Demo ƒ
/
Wipes ƒ
/
Four corner wipe.c
< prev
next >
Wrap
Text File
|
1994-04-15
|
3KB
|
80 lines
/**********************************************************************\
File: Four corner wipe.c
Purpose: Graphic effect from offscreen bitmap to main window (on
screen). See comments below for more description.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program in a file named "GNU General Public License".
If not, write to the Free Software Foundation, 675 Mass Ave,
Cambridge, MA 02139, USA.
\**********************************************************************/
#include "timing.h"
#define CorrectTime 1
#define theWindowHeight (boundsRect.bottom-boundsRect.top)
#define theWindowWidth (boundsRect.right-boundsRect.left)
pascal short FourCorner(GrafPtr sourceGrafPtr, GrafPtr destGrafPtr, Rect boundsRect);
/* Take 4 bars, two on each axis, and move them towards different corners.
This means lots of overlap copying, but the timing masks it and Quickdraw
may even take care of some of it. (?) */
pascal short FourCorner(GrafPtr sourceGrafPtr, GrafPtr destGrafPtr, Rect boundsRect)
{
Rect vsource1,hsource1,vsource2,hsource2;
int vbar,hbar,cx,cy;
int VBarGap, HBarGap;
VBarGap=theWindowWidth/100;
HBarGap=theWindowHeight/100;
vbar=VBarGap;
hbar=HBarGap;
cx = boundsRect.left + theWindowWidth/2;
cy = boundsRect.top + theWindowHeight/2;
vsource1.top=vsource2.top=boundsRect.top;
hsource2.left=hsource1.left=boundsRect.left;
vsource1.bottom=vsource2.bottom=boundsRect.bottom;
hsource1.right=hsource2.right=boundsRect.right;
while (vbar+boundsRect.left<cx+VBarGap)
{
StartTiming();
vsource1.left=cx-vbar;
vsource1.right=vsource1.left+VBarGap;
vsource2.right=cx+vbar;
vsource2.left=vsource2.right-VBarGap;
hsource1.top=cy-hbar;
hsource1.bottom=hsource1.top+HBarGap;
hsource2.bottom=cy+hbar;
hsource2.top=hsource2.bottom-HBarGap;
CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
&vsource1, &vsource1, 0, 0L);
CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
&hsource1, &hsource1, 0, 0L);
CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
&vsource2, &vsource2, 0, 0L);
CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
&hsource2, &hsource2, 0, 0L);
vbar+=VBarGap;
hbar+=HBarGap;
TimeCorrection(CorrectTime);
}
return 0;
}